home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 4 #1 / Commodore_Disk_User_Vol.4_1_1990_-.d64 / money plus.bas (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  15KB  |  433 lines

  1. 1000 rem   "money/plus 64"   disk/tape,40col   p.g.simonds  19/2/90
  2. 1010 rem budgets to nearest pound for expenses and incomes up to \9999.
  3. 1020 rem annual totals up to \99999.
  4. 1030 rem printouts can start at any month of the year.
  5. 1050 poke53280,0:poke53281,0:printchr$(147);chr$(30):print" welcome to"
  6. 1060 print:print" money/plus 64."
  7. 1100 e=30+1:i=10+1:l$="":forp=1to21:l$=l$+chr$(192):nextp:forp=1to4000:nextp
  8. 1110 dime(12,31):dimi(12,11):dime$(31):dimi$(11):dimmo$(12):dimet(12):dimit(12)
  9. 1120 dimmt(12):dimrt(12):sp$="         ":dimes$(31):dimis$(11)
  10. 1130 n=0:e=e-1:i=i-1:h$=chr$(176)+l$+chr$(174):b$=chr$(173)+l$+chr$(253)
  11. 1140 mo$(1)="jan":mo$(2)="feb":mo$(3)="mar":mo$(4)="apr":mo$(5)="may"
  12. 1150 mo$(6)="jun":mo$(12)="dec"
  13. 1160 mo$(7)="jul":mo$(8)="aug":mo$(9)="sep":mo$(10)="oct":mo$(11)="nov"
  14. 1170 e$(01)="expense 1   ":e$(02)="expense 2   ":e$(03)="expense 3   "
  15. 1180 e$(04)="            ":e$(05)="            ":e$(06)="            "
  16. 1190 e$(07)="            ":e$(08)="            ":e$(09)="            "
  17. 1200 e$(10)="            ":e$(11)="            ":e$(12)="            "
  18. 1210 e$(13)="            ":e$(14)="            ":e$(15)="            "
  19. 1220 e$(16)="            ":e$(17)="            ":e$(18)="            "
  20. 1230 e$(19)="            ":e$(20)="            ":e$(21)="            "
  21. 1240 e$(22)="            ":e$(23)="            ":e$(24)="            "
  22. 1250 e$(25)="            ":e$(26)="            ":e$(27)="            "
  23. 1260 e$(28)="            ":e$(29)="            ":e$(30)="last exp.   "
  24. 1270 i$(01)="income 1    ":i$(02)="income 2    ":i$(03)="income 3    "
  25. 1280 i$(04)="            ":i$(05)="            ":i$(06)="            "
  26. 1290 i$(07)="            ":i$(08)="            ":i$(09)="            "
  27. 1300 i$(10)="last inc.   "
  28. 1310 goto4000
  29. 2000 rem calculation routine
  30. 2010 n=1:z=0:y=0
  31. 2020 forp=1to12:et(p)=0:forr=1toe:et(p)=et(p)+e(p,r):nextr:z=z+et(p):nextp
  32. 2030 forp=1to12:it(p)=0:forr=1toi:it(p)=it(p)+i(p,r):nextr:y=y+it(p):nextp
  33. 2040 forp=1to12:mt(p)=it(p)-et(p):nextp
  34. 2050 printchr$(147):forp=1to6:print:nextp
  35. 2060 input"         1st month number";sm:ifsm<1orsm>12then2050
  36. 2070 rr=sm
  37. 2080 rt(sm)=mt(sm):x=rt(sm)
  38. 2090 forp=1to11
  39. 2100 sm=sm+1:ifsm=13thensm=1
  40. 2110 rt(sm)=x+mt(sm):x=rt(sm)
  41. 2120 nextp
  42. 2130 ifrt(sm)=y-zthen2150
  43. 2140 print"incorrect calculation!":stop
  44. 2150 sm=rr
  45. 3000 rem annual statement for screen
  46. 3010 sm=rr:ifsm=0thensm=1
  47. 3020 ul$=chr$(159)+"    ===== ===== ======= ======":ac=mt(sm):printchr$(147);
  48. 3030 printchr$(159);"            ";chr$(18);" annual statement ";chr$(146):print
  49. 3040 printchr$(155);"         ";chr$(18);"credit";chr$(146);" ";
  50. 3050 printchr$(18);"debit";chr$(146);" ";chr$(18);"balance";chr$(146);" ";
  51. 3060 printchr$(18);"accum.";chr$(146):print
  52. 3070 forp=1to12:printchr$(158)"    ";chr$(18);mo$(sm);chr$(146);"  ";chr$(5);
  53. 3080 printright$("      "+str$(it(sm)),6);right$("      "+str$(et(sm)),6);
  54. 3090 printright$("        "+str$(mt(sm)),8);right$("       "+str$(ac),7)
  55. 3100 sm=sm+1:ifsm=13thensm=1
  56. 3110 ac=ac+mt(sm):nextp
  57. 3120 print"      ";ul$;chr$(5)
  58. 3130 print"      ";right$("         "+str$(y),9);
  59. 3140 printright$("      "+str$(z),6);
  60. 3150 printright$("        "+str$(y-z),8);right$("       "+str$(ac-mt(sm)),7)
  61. 3160 print"      ";ul$:print:print:print"    (press m,p,e or i)"
  62. 3170 geta$
  63. 3180 ifa$=""then3170
  64. 3190 ifa$="m"then4000
  65. 3200 ifa$="p"then5000
  66. 3210 ifa$="e"thensm=rr:bb$="e":goto8000
  67. 3220 ifa$="i"thensm=rr:bb$="i":goto8000
  68. 3230 goto3170
  69. 4000 rem menu
  70. 4010 sm=rr:ifsm=0thensm=1
  71. 4020 a1$=chr$(18)+" "+chr$(146)+chr$(5)+" "
  72. 4030 a2$=" "+chr$(153):a3$="  "+chr$(18)+chr$(155)+" "
  73. 4040 a3$="  "+chr$(18)+chr$(155)+" "
  74. 4050 a$=chr$(18)+" "+chr$(146)+"                     "+chr$(18)+" "
  75. 4060 printchr$(147);chr$(155);sp$;chr$(18);"                       "
  76. 4070 printsp$;chr$(155);chr$(18);"        m e n u        "
  77. 4080 printsp$;chr$(18);"                       ":printsp$;a$
  78. 4090 printsp$;a1$;"calculate.......";a2$;"c";a3$:printsp$;a$
  79. 4100 printsp$;a1$;"change headings.";a2$;"h";a3$:printsp$;a$
  80. 4110 printsp$;a1$;"monthly display.";a2$;"m";a3$:printsp$;a$
  81. 4120 printsp$;a1$;"printer.........";a2$;"p";a3$:printsp$;a$
  82. 4130 printsp$;a1$;"change income...";a2$;"i";a3$:printsp$;a$
  83. 4140 printsp$;a1$;"change expenses.";a2$;"e";a3$:printsp$;a$
  84. 4150 printsp$;a1$;"analyze data....";a2$;"a";a3$:printsp$;a$
  85. 4160 printsp$;a1$;"annual view.....";a2$;"y";a3$:printsp$;a$
  86. 4170 printsp$;a1$;"save file.......";a2$;"s";a3$:printsp$;a$
  87. 4180 printsp$;a1$;"load file.......";a2$;"l";a3$:printsp$;a$
  88. 4190 printsp$;chr$(18);"                       "chr$(146);chr$(19)
  89. 4200 getbb$
  90. 4210 xx=0
  91. 4220 ifbb$="c"andkk=1thenprintchr$(147);chr$(5);:goto4320
  92. 4230 ifbb$="i"orbb$="e"then8000
  93. 4240 ifbb$="h"then13000
  94. 4250 ifbb$="s"andkk=1then11000
  95. 4260 ifbb$="m"andn=1then9000
  96. 4270 ifbb$="y"andn=1then3000
  97. 4280 ifbb$="p"andn=1then5000
  98. 4290 ifbb$="a"andn=1then10000
  99. 4300 ifbb$="l"then12000
  100. 4310 goto4200
  101. 4320 forp=1to7:print:nextp:print"             ";chr$(18);chr$(130);
  102. 4330 print" calculating. ";chr$(132);chr$(146):goto2000
  103. 5000 rem printer routine
  104. 5010 p1$="                     ":p2$=p1$+p1$+p1$+p1$:printchr$(147):print
  105. 5020 printchr$(155);"    is printer connected? (y/n)"
  106. 5025 y$="":gety$:ify$=""then5025
  107. 5027 ify$<>"y"then4000
  108. 5030 print:print:print"    is printer loaded? (y/n)"
  109. 5035 y$="":gety$:ify$=""then5035
  110. 5037 ify$<>"y"then4000
  111. 5040 print:print:print"    is printer turned on? (y/n)"
  112. 5050 y$="":gety$:ify$=""then5050
  113. 5055 ify$<>"y"then4000
  114. 5060 printchr$(5):print:input"    date";dt$
  115. 5070 pa=0:print:print:input"    page number 1 or 2";pa:ifpa<1orpa>2then4000
  116. 5080 print:print:printchr$(155);"    annual/monthly statement? (a/m)"
  117. 5085 cc$="":getcc$:ifcc$=""then5085
  118. 5090 ifcc$="a"then6000
  119. 5100 ifcc$="m"then7000
  120. 5110 goto4000
  121. 6000 rem print annual budget
  122. 6010 open4,4:cmd4:gosub6380
  123. 6020 print"annual budget ";dt$:s=len(dt$)+14:gosub6380
  124. 6030 forp=1tos:print"=";:nextp:print:print
  125. 6040 lu$="============== ---- ---- ---- ---- ---- ---- ---- ---- ---- ----"
  126. 6050 lu$=lu$+" ---- ---- =====":gosub6380
  127. 6060 print"income        ";:gosub6410:gosub6380:printlu$:sm=rr:forp=1toi
  128. 6070 ss=0:form=1to12:ss=ss+i(m,p):nextm
  129. 6080 ifi$(p)="            "andss=0then6130
  130. 6090 gosub6380:printmid$(str$(p)+"  ",2,3);left$(i$(p),11);:form=1to12
  131. 6100 d=i(sm,p):printright$("    "+str$(d),5);
  132. 6110 sm=sm+1:ifsm=13thensm=1
  133. 6120 nextm:d=ss:printright$("      "+str$(d),6)
  134. 6130 nextp:gosub6380:printlu$
  135. 6140 gosub6380:print"totals        ";:ss=0:form=1to12:d=it(sm):ss=ss+d
  136. 6150 printright$("    "+str$(d),5);:sm=sm+1:ifsm=13thensm=1
  137. 6160 nextm:d=ss:printright$("      "+str$(d),6):gosub6380:printlu$:print:print
  138. 6170 print:gosub6380:print"expenses      ";:gosub6410:gosub6380:printlu$
  139. 6180 sm=rr:forp=1toe:ss=0:form=1to12:ss=ss+e(m,p):nextm
  140. 6190 ife$(p)="            "andss=0then6240
  141. 6200 gosub6380:printmid$(str$(p)+"  ",2,3);:printleft$(e$(p),11);
  142. 6210 form=1to12:d=e(sm,p):printright$("    "+str$(d),5);
  143. 6220 sm=sm+1:ifsm=13thensm=1
  144. 6230 nextm:d=ss:printright$("      "+str$(d),6)
  145. 6240 nextp
  146. 6250 gosub6380:printlu$:gosub6380:print"totals        ";:ss=0
  147. 6260 form=1to12:d=et(sm):ss=ss+d:printright$("    "+str$(d),5);
  148. 6270 sm=sm+1:ifsm=13thensm=1
  149. 6280 nextm:d=ss:printright$("      "+str$(d),6):gosub6380:printlu$:print:print
  150. 6290 print:gosub6380:print"              ";:gosub6410:gosub6380:printlu$
  151. 6300 gosub6380:print"balances      ";:ss=0:sm=rr:form=1to12
  152. 6310 d=mt(sm):ss=ss+d:printright$("    "+str$(d),5);:sm=sm+1:ifsm=13thensm=1
  153. 6320 nextm:d=ss:printright$("      "+str$(d),6):gosub6380:printlu$:print:print
  154. 6330 print:gosub6380:print"              ";:gosub6410:gosub6380:printlu$
  155. 6340 gosub6380:print"accumulation  ";:sm=rr:form=1to12:d=rt(sm)
  156. 6350 printright$("    "+str$(d),5);:sm=sm+1:ifsm=13thensm=1
  157. 6360 nextm:d=y-z:printright$("      "+str$(d),6):gosub6380:printlu$
  158. 6370 print#4:close4,4:goto4000
  159. 6380 rem print blank page one subroutine
  160. 6390 ifpa=2thenprintp2$;
  161. 6400 return
  162. 6410 rem print months subroutine
  163. 6420 sm=rr:forp=1to12:print"  ";mo$(sm);:sm=sm+1:ifsm=13thensm=1
  164. 6430 nextp:print" total":return
  165. 7000 rem print monthly statement
  166. 7010 uu$="----------------------":printchr$(5):print
  167. 7020 input"    number of month to be printed";m:ifm<1orm>12then4000
  168. 7030 open4,4:cmd4:printchr$(14);:gosub6380:printdt$:s=len(dt$):gosub6380
  169. 7040 forp=1tos:print"=";:nextp:print:print:gosub6380
  170. 7050 print"estimates for the month of ";mo$(m):gosub6380
  171. 7060 print"------------------------------":print:gosub6380
  172. 7070 print"income:-             \":gosub6380:printuu$:forp=1toi
  173. 7080 ifi(m,p)=0ori$(p)=""then7100
  174. 7090 gosub6380:printi$(p);"      ";right$("    "+str$(i(m,p)),4)
  175. 7100 nextp:gosub6380:printuu$:gosub6380
  176. 7110 print"total income    ";right$("    "+str$(it(m)),6):gosub6380
  177. 7120 printuu$:print:gosub6380:print"expenses:-           \"
  178. 7130 gosub6380:printuu$:forp=1toe
  179. 7140 ife(m,p)=0ore$(p)=""then7160
  180. 7150 gosub6380:printe$(p);"      ";right$("    "+str$(e(m,p)),4)
  181. 7160 nextp
  182. 7170 gosub6380:printuu$:gosub6380
  183. 7180 print"total expenses  ";right$("    "+str$(et(m)),6):gosub6380
  184. 7190 printuu$:print:gosub6380:printuu$:gosub6380
  185. 7200 print"balance         ";right$("    "+str$(mt(m)),6)
  186. 7210 gosub6380:printuu$:print:gosub6380:printuu$:gosub6380
  187. 7220 print"accumulation    ";right$("    "+str$(rt(m)),6):gosub6380:printuu$
  188. 7230 print#4,chr$(15):print#4:close4,4:goto4000
  189. 8000 rem data check and change routine
  190. 8010 fd=0:md$="e":ifbb$="i"thenmd$="i"
  191. 8020 ca$=chr$(5)+chr$(18)+chr$(130)+chr$(157)+chr$(157)+chr$(157)
  192. 8030 ca$=ca$+"calculating"+chr$(132)+chr$(146)
  193. 8040 r$="":forp=1to24:r$=r$+chr$(29):nextp
  194. 8050 co=sm:kk=1:ro=1:ifsm=0thensm=1:co=sm
  195. 8060 c$=chr$(158)+chr$(130)+chr$(175)+chr$(132)+chr$(5)+chr$(157)
  196. 8070 iffd=0thengoto8440
  197. 8080 hh$="":gethh$:ifhh$=""then8080
  198. 8085 ifhh$=chr$(145)thenro=ro-1:ifro<1thenro=1:goto8350
  199. 8090 ifhh$=chr$(145)then8350
  200. 8100 ifhh$=chr$(17)andbb$="e"andro<ethenro=ro+1:goto8350
  201. 8110 ifhh$=chr$(17)andbb$="i"andro<ithenro=ro+1:goto8350
  202. 8120 ifhh$=chr$(29)thenco=co+1:ifco>12thenco=1:goto8350
  203. 8130 ifhh$=chr$(157)thenco=co-1:ifco<1thenco=12:goto8350
  204. 8140 ifhh$=chr$(29)orhh$=chr$(157)then8350
  205. 8150 ifhh$="e"andbb$="e"then8080
  206. 8160 ifhh$="e"thenbb$="e":ro=1:co=sm:goto8350
  207. 8170 ifhh$="i"andbb$="i"then8080
  208. 8180 ifhh$="i"thenbb$="i":ro=1:co=sm:goto8350
  209. 8190 ifhh$="c"thenn=0:printc$;:bn$="":goto8240
  210. 8200 ifhh$="m"andn=1then4000
  211. 8210 ifhh$="y"andn=1thensm=rr:goto3000
  212. 8220 ifhh$="m"thenprintca$:sm=rr:goto2000
  213. 8230 goto8080
  214. 8240 nu$="":getnu$:ifnu$=""then8240
  215. 8243 ifnu$=chr$(13)then8280
  216. 8245 ifnu$="a"then8310
  217. 8250 ifasc(nu$)-48<0orasc(nu$)-48>10then8240
  218. 8260 bn$=bn$+nu$:iflen(bn$)>4then8280
  219. 8270 printnu$;c$;:goto8240
  220. 8280 nu=val(left$(bn$,4))
  221. 8290 ifbb$="e"thene(co,ro)=nu:nu=0:goto8350
  222. 8300 ifbb$="i"theni(co,ro)=nu:nu=0:goto8350
  223. 8310 nu=val(left$(bn$,4))
  224. 8320 forp=1to12
  225. 8330 ifbb$="e"thene(p,ro)=nu
  226. 8335 ifbb$="i"theni(p,ro)=nu
  227. 8340 nextp:nu=0
  228. 8350 printchr$(19);chr$(5);chr$(146):print:print:printleft$(r$,13);
  229. 8360 ifbb$="e"thenprint"e x p e n s e s":goto8370
  230. 8365 print"  i n c o m e   "
  231. 8370 print:print:print:print:printr$;chr$(18);chr$(158);"  ";mo$(co);"  "
  232. 8380 print:print:printleft$(r$,14);chr$(153);mid$((str$(ro)+"  "),2,2);
  233. 8390 ifbb$="e"thenprintleft$(r$,2);e$(ro):goto8400
  234. 8395 printleft$(r$,2);i$(ro)
  235. 8400 print:print:print:printleft$(r$,12);chr$(153);
  236. 8410 ifbb$="e"thenprintmid$((str$(e(co,ro))+"     "),2,5);chr$(29);
  237. 8420 ifbb$="i"thenprintmid$((str$(i(co,ro))+"     "),2,5);chr$(29);
  238. 8430 printleft$(r$,5);"     ";:forp=1to5:printchr$(157);:nextp:goto8080
  239. 8440 fd=1:printchr$(147):printchr$(155);sp$;chr$(18);h$
  240. 8450 ed$=sp$+chr$(18)+chr$(125)+chr$(146)+"                     "+chr$(18)
  241. 8460 ed$=ed$+chr$(125):printed$:printed$:printed$
  242. 8470 printsp$;chr$(18);b$:print
  243. 8480 printsp$;chr$(18);h$
  244. 8490 print"  ";chr$(158);"<left> ";chr$(155);chr$(18);chr$(125);
  245. 8500 print"   m o n t h  ";chr$(146);"       ";chr$(18);chr$(125);chr$(146);
  246. 8510 printchr$(158);" <right>";
  247. 8520 printchr$(155);sp$;chr$(18);b$:print
  248. 8530 printsp$;chr$(18);left$(h$,7);chr$(178);right$(h$,15)
  249. 8540 print"    ";chr$(153);"<up> ";chr$(155);chr$(18);chr$(125);"row ";
  250. 8550 printchr$(146);"  ";chr$(18);chr$(125);chr$(146);"              ";chr$(18);
  251. 8560 printchr$(125);chr$(146);chr$(153);" <down>";chr$(155)
  252. 8570 printsp$;chr$(18);left$(b$,7);chr$(177);right$(b$,15):print
  253. 8580 printsp$;left$(h$,10);chr$(178);right$(h$,12)
  254. 8590 printsp$;chr$(125);sp$;chr$(125);sp$;"  ";chr$(125)
  255. 8600 printsp$;left$(b$,10);chr$(177);right$(b$,12):print
  256. 8610 printsp$;chr$(18);"                       "
  257. 8620 printsp$;chr$(18);" ";chr$(158);"1 to change press [c]";chr$(155);" "
  258. 8630 printsp$;chr$(18);" ";chr$(158);"2 use return to enter";chr$(155);" "
  259. 8640 printsp$;chr$(18);" ";chr$(158);"3 change all year [a]";chr$(155);" "
  260. 8650 printsp$;chr$(18);" ";chr$(158);"4 to quit press [m]  ";chr$(155);" "
  261. 8660 printsp$;chr$(18);"                       ";:goto8350
  262. 9000 rem monthly preview on screen
  263. 9010 sm=rr:printchr$(147);chr$(153);"press up,";chr$(18);chr$(155);
  264. 9020 print"income     "chr$(5);mo$(sm);chr$(155);"        ":sc=1
  265. 9030 forp=1toi
  266. 9040 ifi(sm,p)=0then9080
  267. 9050 printsp$;chr$(18);chr$(155);mid$(str$(p)+"  ",2,3);
  268. 9060 printchr$(18);i$(p);" ";chr$(146);chr$(5);
  269. 9070 printright$("     "+str$(i(sm,p)),5);chr$(155);chr$(18);" ":sc=sc+1
  270. 9080 nextp
  271. 9090 printchr$(153);"down,m,p,";chr$(155);chr$(18);"total income   =";chr$(5);
  272. 9100 printchr$(18);right$("     "+str$(it(sm)),5);chr$(155);" "
  273. 9110 printchr$(153);"y,e or i.";chr$(158);chr$(18);"expenses              "
  274. 9120 sc=sc+2:forp=1toe
  275. 9130 ife(sm,p)=0then9170
  276. 9140 printsp$;chr$(158);chr$(18);mid$(str$(p)+"  ",2,3);
  277. 9150 printe$(p);" ";chr$(146);chr$(5);
  278. 9160 printright$("     "+str$(e(sm,p)),5);chr$(158);chr$(18);" ":sc=sc+1
  279. 9165 ifsc=24thenprintchr$(130);"any key.";chr$(145)
  280. 9167 ifsc=24thensc$="":getsc$:ifsc$=""then9167
  281. 9170 nextp
  282. 9180 printsp$;chr$(158);chr$(18);"total expenses =";chr$(5);
  283. 9190 printright$("     "+str$(et(sm)),5);chr$(158);" "
  284. 9200 printsp$;chr$(18);chr$(159);"balance        =";
  285. 9210 printchr$(18);right$("     "+str$(mt(sm)),5);chr$(159);" ";
  286. 9220 printchr$(155);chr$(19)
  287. 9230 a$=""
  288. 9240 a$="":geta$:ifa$=""then9240
  289. 9250 ifa$="i"thenbb$="i":goto8000
  290. 9260 ifa$="e"thenbb$="e":goto8000
  291. 9270 ifa$="m"thensm=rr:goto4000
  292. 9280 ifa$="y"thensm=rr:goto3000
  293. 9290 ifa$="p"thensm=rr:goto5000
  294. 9300 printchr$(147);chr$(153);"press up,";chr$(155);chr$(18);
  295. 9310 ifa$=chr$(145)thensm=sm+10
  296. 9320 sm=sm+1:ifsm>12thensm=sm-12
  297. 9330 goto9020
  298. 10000 rem expense and income annual analysis
  299. 10010 sm=rr:printchr$(147):print:print:print
  300. 10020 printsp$;chr$(18);chr$(159);" analysis of expenses "
  301. 10030 print
  302. 10040 printsp$;chr$(18);" or income? ";chr$(130);" (e or i) ";chr$(5);chr$(132)
  303. 10050 d$="":getd$:ifd$=""then10050
  304. 10060 ifd$="i"then10090
  305. 10070 ifd$="e"then10100
  306. 10080 goto4000
  307. 10090 print:print:printsp$;"income number for analysis.":goto10110
  308. 10100 print:print:printsp$;"expense number for analysis."
  309. 10110 f=1:print:input"         ";f:printchr$(147)
  310. 10120 iff>eorf<1thenprintchr$(19):goto10060
  311. 10130 iff>iandd$="i"thenprintchr$(19):goto10060
  312. 10140 printchr$(19);sp$;chr$(5);"analysis of"
  313. 10150 print
  314. 10160 xx=0
  315. 10170 printsp$;
  316. 10180 ifd$="i"thenprintchr$(18);i$(f);chr$(146);chr$(153);f;chr$(157);" "
  317. 10190 ifd$="e"thenprintchr$(18);e$(f);chr$(146);chr$(153);f;chr$(157);" "
  318. 10200 print
  319. 10210 forp=1to12
  320. 10220 printsp$;chr$(18);chr$(159);mo$(sm);chr$(146);chr$(5);"    ";
  321. 10230 ifd$="i"thend=i(sm,f)
  322. 10240 ifd$="e"thend=e(sm,f)
  323. 10250 xx=xx+d
  324. 10260 printright$("     "+str$(d),5)
  325. 10270 sm=sm+1:ifsm=13thensm=1
  326. 10280 nextp
  327. 10290 print:printsp$;"============"
  328. 10300 printsp$;"total  ";
  329. 10310 printright$("     "+str$(xx),5)
  330. 10320 printsp$;"============":print
  331. 10330 printsp$;chr$(153);"cursor  <up> or <down>":print
  332. 10340 printsp$;chr$(5);"analysis or menu? (a/m)"
  333. 10350 e$="":gete$:ife$=""then10350
  334. 10360 ife$=chr$(145)andf>1thenf=f-1:goto10120
  335. 10370 ife$="m"then4000
  336. 10380 ife$="a"then10000
  337. 10390 ife$=chr$(17)andd$="i"andf<ithenf=f+1:goto10120
  338. 10400 ife$=chr$(17)andd$="e"andf<ethenf=f+1:goto10120
  339. 10410 goto10350
  340. 11000 rem save file to disk or tape
  341. 11010 printchr$(147):ify=0orz=0then4000
  342. 11020 printchr$(147);chr$(155);chr$(130):forp=1to6:print:nextp:p$=""
  343. 11030 print"     save on tape or disk? (t or d)":printchr$(132)
  344. 11035 p$="":getp$:ifp$=""then11035
  345. 11040 ifp$="t"orp$="d"then11050
  346. 11045 goto4000
  347. 11050 printchr$(147);chr$(5):forp=1to6:print:nextp:printsp$;"    ";
  348. 11060 printchr$(130);chr$(18);" saving file. ";chr$(132);chr$(146):print
  349. 11070 ifp$="d"thenopen1,8,2,"@0:expenses,s,w":goto11080
  350. 11075 open1,1,1,"expenses"
  351. 11080 forc=1to12:forr=1toe:print#1,e(c,r):nextr:nextc:close1
  352. 11090 ifp$="d"thenopen3,8,2,"@0:expheads,s,w":goto11100
  353. 11095 open3,1,1,"expheads"
  354. 11100 forc=1toe:es$(c)="f"+e$(c)+"b":print#3,es$(c):nextc:close3
  355. 11110 ifp$="d"thenopen2,8,2,"@0:income,s,w":goto11120
  356. 11115 open2,1,1,"income"
  357. 11120 forc=1to12:forr=1toi:print#2,i(c,r):nextr:nextc:close2
  358. 11130 ifp$="d"thenopen4,8,2,"@0:incheads,s,w":goto11140
  359. 11135 open4,1,1,"incheads"
  360. 11140 forc=1toi:is$(c)="f"+i$(c)+"b":print#4,is$(c):nextc:close4
  361. 11150 goto4000
  362. 12000 rem load file from disk or tape
  363. 12010 printchr$(147);chr$(155):forp=1to6:print:nextp:print"   ";
  364. 12020 p$="":print"load from tape or disk? (t or d)"
  365. 12025 p$="":getp$:ifp$=""then12025
  366. 12030 ifp$="d"orp$="t"then12040
  367. 12035 goto4000
  368. 12040 printchr$(147):forp=1to6:print:nextp:printsp$;"   ";
  369. 12050 printchr$(130);chr$(5);chr$(18);" loading file. ";chr$(132);chr$(146)
  370. 12060 ifp$="d"thenopen1,8,2,"0:expenses,s,r":goto12070
  371. 12065 open1,1,0,"expenses"
  372. 12070 forc=1to12:forr=1toe:input#1,e(c,r):nextr:nextc:close1
  373. 12080 ifp$="d"thenopen3,8,2,"0:expheads,s,r":goto12090
  374. 12085 open3,1,0,"expheads"
  375. 12090 forc=1toe:input#3,es$(c):e$(c)=mid$(es$(c),2,12):nextc:close3
  376. 12100 ifp$="d"thenopen2,8,2,"0:income,s,r":goto12110
  377. 12105 open2,1,0,"income"
  378. 12110 forc=1to12:forr=1toi:input#2,i(c,r):nextr:nextc:close2
  379. 12120 ifp$="d"thenopen4,8,2,"0:incheads,s,r":goto12130
  380. 12125 open4,1,0,"incheads"
  381. 12130 forc=1toi:input#4,is$(c):i$(c)=mid$(is$(c),2,12):nextc:close4
  382. 12140 kk=1:printchr$(147);chr$(5):forp=1to6:print:nextp:print"             ";
  383. 12150 printchr$(18);chr$(130);" calculating. ";chr$(132);chr$(146):goto2000
  384. 13000 rem change expenses and income headings
  385. 13010 printchr$(147);chr$(155);
  386. 13020 print"change heading for expense/income (e/i)?":print
  387. 13030 print"check headings  or  goto menu  (c/m)?"
  388. 13040 ch$="":getch$:ifch$=""then13040
  389. 13043 ifch$="e"then13060
  390. 13045 ifch$="i"then13140
  391. 13047 ifch$="c"then13230
  392. 13048 goto4000
  393. 13050 ifch$="c"then13230
  394. 13055 goto4000
  395. 13060 print:print"which expense number is to be changed?"
  396. 13070 print"[ 1  - ";e;"]":print
  397. 13080 lc=0:inputlc:iflc<1orlc>ethen4000
  398. 13090 print:print"  ";e$(lc)
  399. 13100 print" >------------<    (12 characters only)";chr$(145);chr$(145)
  400. 13110 es$(lc)="":inputes$(lc):ifes$(lc)=""thenes$(lc)="            "
  401. 13120 e$(lc)="":e$(lc)=left$(es$(lc)+"            ",12)
  402. 13130 goto13300
  403. 13140 print
  404. 13150 print"which income number is to be changed?"
  405. 13160 print"[ 1  - ";i;"]":print
  406. 13170 lc=0:inputlc:iflc<1orlc>ithen4000
  407. 13180 print:print"  ";i$(lc)
  408. 13190 print" >------------<    (12 characters only)";chr$(145);chr$(145)
  409. 13200 is$(lc)="":inputis$(lc):ifis$(lc)=""thenis$(lc)="            "
  410. 13210 i$(lc)="":i$(lc)=left$(is$(lc)+"            ",12)
  411. 13220 goto13230
  412. 13230 printchr$(147);"income        no."
  413. 13240 print"================="
  414. 13250 lc=1
  415. 13260 printi$(lc);right$("   "+str$(lc),4):lc=lc+1
  416. 13270 iflc<(i+1)then13260
  417. 13280 print:print"press  [i]  to change income.";chr$(145)
  418. 13290 ch$="":getch$:ifch$=""then13290
  419. 13295 ifch$="i"then13150
  420. 13300 printchr$(147);
  421. 13310 print"expense       no.     expense       no."
  422. 13320 print"=================     ================="
  423. 13330 lc=1:ha=int((e+1)/2)
  424. 13350 printe$(lc);right$("   "+str$(lc),4);"      ";
  425. 13360 if(lc+ha)<=ethenprinte$(lc+ha);" ";(lc+ha):goto13370
  426. 13365 print
  427. 13370 lc=lc+1
  428. 13380 iflc<(int((e+1)/2)+1)then13350
  429. 13390 print:print"press  [e]  to change expense."
  430. 13400 ch$="":getch$:ifch$=""then13400
  431. 13405 ifch$="e"thenprintchr$(145);chr$(145);:goto13060
  432. 13410 goto4000
  433.